<template>
  <div class="choose">
    <div class="main-title">
      <b>{{ message.title }}</b>
    </div>
    <div class="description">
      <span>{{ message.description }}</span>
    </div>
    <div class="goto">
      <el-button size="large" text @click="gotoRouter">
        <b>{{ message.enter }}</b>
      </el-button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const props = defineProps({
  message: {
    title: String,
    description: String,
    enter: String,
    goto: String,
  },
})
const gotoRouter = () => {
  router.push({ path: props.message.goto })
}
</script>

<style scoped less="scss">
.choose {
  position: relative;

  /* 弹性布局 */
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: 10px;

  width: 500px;
  height: 300px;
  background-color: white;
  border-radius: 15px;
  border: 1px solid rgb(236, 236, 236);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 2px;
  transition: all 0.5s;

  /* 主标题 */
  .main-title {
    margin-top: 50px;
    width: 100%;
    padding-left: 20px;
    font-size: 2rem;
  }

  /* 描述 */
  .description {
    padding: 0 20px 0 20px;
    font-size: 1.1rem;
  }

  /* 按钮 */
  .goto {
    position: absolute;
    top: 230px;
    right: 10%;
  }
}

.choose:hover {
  transform: translateY(-3px);
  background-color: #def2e2;
}
</style>
